#include <iostream>
#include <string>
using namespace std;

// 声明一个复合结构
struct person
{
    int age;
    float weight;
};

// 重载*操作符，自定义内部实现
person operator*(const person &a, const person &b)
{
    person c = {a.age + b.age, a.weight + b.weight};
    return c;
}

// 重载+操作符
int operator+(const person &a, const person &b)
{
    return a.age + b.age;
}

// 重载输出流
ostream &operator<<(ostream &os, const person &p)
{
    os << p.age << ", " << p.weight;
    return os;
}

int main()
{
    person a = {12, 30.7};
    person b = {23, 78.6};

    auto c = a * b;
    auto ee = a + b;

    float x = 3.89;
    char y = 'y';
    string s = "hello";

    cout << a << " | "
         << b << " | " << c << endl;
    cout << x << ", " << y << ", " << s << endl;
    return 0;
}